package com.xbongbong.saas.domain.dao;

import com.xbongbong.saas.domain.entity.CouponTempleteEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

@Mapper
@Repository
public interface CouponTempleteDao {
    Long insert(CouponTempleteEntity entity);

    void insertBatch(List<CouponTempleteEntity> list);

    CouponTempleteEntity getByKey(@Param("key") Long key, @Param("corpid") String corpid );

    Integer update(CouponTempleteEntity entity);

    List<CouponTempleteEntity> findEntities(@Param("param") Map<String, Object> param);

    Integer getEntitiesCount(@Param("param") Map<String, Object> param);

    Integer deleteByKey(@Param("key") Long key, @Param("corpid")String corpid);

    Integer getOnlineCouponCount(@Param("corpid")String corpid);

    void updateUsedNum(@Param("list")List<CouponTempleteEntity> updateList,@Param("corpid") String corpid);

    void updateStatus(@Param("list")List<CouponTempleteEntity> updateList,@Param("corpid") String corpid);

    List<String> findCorpid();

}